Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
b97aec31
Commit
b97aec31
authored
14 years ago
by
dt
Browse files
Options
Downloads
Patches
Plain Diff
Path Chooser: Add a basedirectory
Reviewed-By: Friedemann Kleint
parent
02a4fc72
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/libs/utils/pathchooser.cpp
+16
-1
16 additions, 1 deletion
src/libs/utils/pathchooser.cpp
src/libs/utils/pathchooser.h
+4
-0
4 additions, 0 deletions
src/libs/utils/pathchooser.h
with
20 additions
and
1 deletion
src/libs/utils/pathchooser.cpp
+
16
−
1
View file @
b97aec31
...
@@ -89,6 +89,7 @@ struct PathChooserPrivate
...
@@ -89,6 +89,7 @@ struct PathChooserPrivate
QString
m_dialogTitleOverride
;
QString
m_dialogTitleOverride
;
QString
m_dialogFilter
;
QString
m_dialogFilter
;
QString
m_initialBrowsePathOverride
;
QString
m_initialBrowsePathOverride
;
QString
m_baseDirectory
;
};
};
PathChooserPrivate
::
PathChooserPrivate
(
PathChooser
*
chooser
)
:
PathChooserPrivate
::
PathChooserPrivate
(
PathChooser
*
chooser
)
:
...
@@ -142,9 +143,23 @@ QAbstractButton *PathChooser::buttonAtIndex(int index) const
...
@@ -142,9 +143,23 @@ QAbstractButton *PathChooser::buttonAtIndex(int index) const
return
findChildren
<
QAbstractButton
*>
().
at
(
index
);
return
findChildren
<
QAbstractButton
*>
().
at
(
index
);
}
}
QString
PathChooser
::
baseDirectory
()
const
{
return
m_d
->
m_baseDirectory
;
}
void
PathChooser
::
setBaseDirectory
(
const
QString
&
directory
)
{
m_d
->
m_baseDirectory
=
directory
;
}
QString
PathChooser
::
path
()
const
QString
PathChooser
::
path
()
const
{
{
return
m_d
->
m_lineEdit
->
text
();
const
QString
path
=
m_d
->
m_lineEdit
->
text
();
if
(
!
m_d
->
m_baseDirectory
.
isEmpty
()
&&
QFileInfo
(
path
).
isRelative
())
return
QFileInfo
(
m_d
->
m_baseDirectory
+
QLatin1Char
(
'/'
)
+
path
).
absoluteFilePath
();
else
return
QFileInfo
(
path
).
absoluteFilePath
();
}
}
void
PathChooser
::
setPath
(
const
QString
&
path
)
void
PathChooser
::
setPath
(
const
QString
&
path
)
...
...
This diff is collapsed.
Click to expand it.
src/libs/utils/pathchooser.h
+
4
−
0
View file @
b97aec31
...
@@ -56,6 +56,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
...
@@ -56,6 +56,7 @@ class QTCREATOR_UTILS_EXPORT PathChooser : public QWidget
Q_PROPERTY
(
QString
path
READ
path
WRITE
setPath
DESIGNABLE
true
)
Q_PROPERTY
(
QString
path
READ
path
WRITE
setPath
DESIGNABLE
true
)
Q_PROPERTY
(
QString
promptDialogTitle
READ
promptDialogTitle
WRITE
setPromptDialogTitle
DESIGNABLE
true
)
Q_PROPERTY
(
QString
promptDialogTitle
READ
promptDialogTitle
WRITE
setPromptDialogTitle
DESIGNABLE
true
)
Q_PROPERTY
(
Kind
expectedKind
READ
expectedKind
WRITE
setExpectedKind
DESIGNABLE
true
)
Q_PROPERTY
(
Kind
expectedKind
READ
expectedKind
WRITE
setExpectedKind
DESIGNABLE
true
)
Q_PROPERTY
(
QString
baseDirectory
READ
baseDirectory
WRITE
setBaseDirectory
DESIGNABLE
true
)
public:
public:
static
const
char
*
const
browseButtonLabel
;
static
const
char
*
const
browseButtonLabel
;
...
@@ -87,6 +88,9 @@ public:
...
@@ -87,6 +88,9 @@ public:
QString
path
()
const
;
QString
path
()
const
;
QString
baseDirectory
()
const
;
void
setBaseDirectory
(
const
QString
&
directory
);
/** Returns the suggested label title when used in a form layout. */
/** Returns the suggested label title when used in a form layout. */
static
QString
label
();
static
QString
label
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment