예제 #1
0
TracksPanel::TracksPanel(QWidget *parent) :
    SidePanel("Tracks", parent),
    d(new TracksPanelPrivate(this)) {

    d->tracks_bus = new TracksBus;
    d->tracks_list = new QWidget;

    auto layout0 = new QVBoxLayout;
    layout0->setMargin(0);
    layout0->setSpacing(0);
    for(int i = 0; i < 16; ++i) {
        layout0->addWidget(new TracksItem);
    }
    layout0->addStretch();
    d->tracks_list->setLayout(layout0);

    auto scroll_area = new QScrollArea;
    scroll_area->setWidgetResizable(true);
    scroll_area->setWidget(d->tracks_list);
    scroll_area->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);

    auto layout = new QVBoxLayout;
    layout->setMargin(0);
    layout->setSpacing(0);
    layout->addWidget(d->tracks_bus);
    layout->addWidget(scroll_area);

    this->centralWidget()->setLayout(layout);
}
예제 #2
0
void ResourceDock::setupHTools() {
	auto htools = new QFrame(this);
	auto vlayout = new QVBoxLayout(htools);
	vlayout->setMargin(2);
	vlayout->setSpacing(0);

	auto hlayoutTitle = new QHBoxLayout();
	auto title = new QLabel(htools);
	title->setText("Resource Explorer ");
	title->setStyleSheet("color: lightGray;");
	hlayoutTitle->addWidget(title);

	auto sepBrush = QBrush(Qt::gray, Qt::BrushStyle::Dense6Pattern);
	QPalette sepPalette;
	sepPalette.setBrush(QPalette::Background, sepBrush);

	auto seprator = new QLabel(htools);
	seprator->setAutoFillBackground(true);
	seprator->setPalette(sepPalette);
	seprator->setMaximumHeight(10);
	hlayoutTitle->addWidget(seprator, 1, Qt::AlignBottom);

	auto btnClose = new QToolButton(htools);
	btnClose->setText("X");
	btnClose->setStyleSheet("color: lightGray\n");
	btnClose->setAutoRaise(true);
	btnClose->setMaximumWidth(16);
	btnClose->setMaximumHeight(16);
	hlayoutTitle->addWidget(btnClose);
	connect(btnClose, &QToolButton::clicked, this, &QDockWidget::hide);

	vlayout->addLayout(hlayoutTitle);
	vlayout->addSpacing(2);

	auto hlayoutTools = new QHBoxLayout();
	hlayoutTools->setMargin(0);
	hlayoutTools->setSpacing(0);

	auto btnCollAll = new QToolButton(htools);
	btnCollAll->setIcon(QIcon(":/icons/col"));
	btnCollAll->setToolTip("Collapse All");
	btnCollAll->setToolButtonStyle(Qt::ToolButtonIconOnly);
	connect(btnCollAll, &QToolButton::clicked, resTree, &QTreeWidget::collapseAll);
	hlayoutTools->addWidget(btnCollAll);
	hlayoutTools->addSpacing(5);

	auto ledit = new QLineEdit(htools);
	ledit->setPlaceholderText("Search");
	ledit->addAction(QIcon(":/icons/search"), QLineEdit::ActionPosition::TrailingPosition);
	ledit->setStyleSheet("background-color: gray;");
	connect(ledit, &QLineEdit::textChanged, this, &ResourceDock::searchAct);
	hlayoutTools->addWidget(ledit, 1);
	vlayout->addLayout(hlayoutTools);

	htools->setLayout(vlayout);

	setTitleBarWidget(htools);
}
EnvironmentAspectWidget::EnvironmentAspectWidget(EnvironmentAspect *aspect, QWidget *additionalWidget) :
    m_aspect(aspect),
    m_additionalWidget(additionalWidget)
{
    QTC_CHECK(m_aspect);

    setContentsMargins(0, 0, 0, 0);
    auto topLayout = new QVBoxLayout(this);
    topLayout->setMargin(0);

    auto baseEnvironmentWidget = new QWidget;
    auto baseLayout = new QHBoxLayout(baseEnvironmentWidget);
    baseLayout->setMargin(0);
    auto label = new QLabel(tr("Base environment for this run configuration:"), this);
    baseLayout->addWidget(label);
    m_baseEnvironmentComboBox = new QComboBox;
    QList<int> bases = m_aspect->possibleBaseEnvironments();
    int currentBase = m_aspect->baseEnvironmentBase();
    QString baseDisplayName;
    foreach (int i, bases) {
        const QString displayName = m_aspect->baseEnvironmentDisplayName(i);
        m_baseEnvironmentComboBox->addItem(displayName, i);
        if (i == currentBase) {
            m_baseEnvironmentComboBox->setCurrentIndex(m_baseEnvironmentComboBox->count() - 1);
            baseDisplayName = displayName;
        }
    }
    if (m_baseEnvironmentComboBox->count() == 1)
        m_baseEnvironmentComboBox->setEnabled(false);

    connect(m_baseEnvironmentComboBox, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
            this, &EnvironmentAspectWidget::baseEnvironmentSelected);

    baseLayout->addWidget(m_baseEnvironmentComboBox);
    baseLayout->addStretch(10);
    if (additionalWidget)
        baseLayout->addWidget(additionalWidget);

    m_environmentWidget = new EnvironmentWidget(this, baseEnvironmentWidget);
    m_environmentWidget->setBaseEnvironment(m_aspect->baseEnvironment());
    m_environmentWidget->setBaseEnvironmentText(baseDisplayName);
    m_environmentWidget->setUserChanges(m_aspect->userEnvironmentChanges());
    m_environmentWidget->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
    topLayout->addWidget(m_environmentWidget);

    connect(m_environmentWidget, &EnvironmentWidget::userChangesChanged,
            this, &EnvironmentAspectWidget::userChangesEdited);

    connect(m_aspect, &EnvironmentAspect::baseEnvironmentChanged,
            this, &EnvironmentAspectWidget::changeBaseEnvironment);
    connect(m_aspect, &EnvironmentAspect::userEnvironmentChangesChanged,
            this, &EnvironmentAspectWidget::changeUserChanges);
    connect(m_aspect, &EnvironmentAspect::environmentChanged,
            this, &EnvironmentAspectWidget::environmentChanged);
}
예제 #4
0
BSPSceneObject::BSPSceneObject(char * filename, int curveTesselation) : RigidSceneObject()
{
	hasVisibility = true;
	
	bspObject = new BSP();
	bspObject->Load(filename,curveTesselation);
	bspObject->buildSingleCluster();
	
	bind(bspObject->clusterObject);
	
	//		bspObject->disableVIS(true);
	//		bspObject->showAll(true);
	
	setMass(0);
	setMargin(0.01f);
	createRigidBody();
	mRigidBody->setActivationState(WANTS_DEACTIVATION); 
	
	segmentMask = new BITSET;
	segmentMask->Init(bspObject->clusterObject.numSegments);
	segmentMask->SetAll();
	
//	createRigidBody();
//	colShape->setMargin(0.005);
}
예제 #5
0
RatingFilter::RatingFilter(QWidget* const parent)
    : KHBox(parent), d(new Private)
{
    d->ratingWidget = new RatingFilterWidget(this);

    d->optionsBtn   = new QToolButton(this);
    d->optionsBtn->setToolTip( i18n("Rating Filter Options"));
    d->optionsBtn->setIcon(KIconLoader::global()->loadIcon("configure", KIconLoader::Toolbar));
    d->optionsBtn->setPopupMode(QToolButton::InstantPopup);

    d->optionsMenu  = new KMenu(d->optionsBtn);
    d->geCondAction = d->optionsMenu->addAction(i18n("Greater Than or Equals Condition"));
    d->geCondAction->setCheckable(true);
    d->eqCondAction = d->optionsMenu->addAction(i18n("Equals Condition"));
    d->eqCondAction->setCheckable(true);
    d->leCondAction = d->optionsMenu->addAction(i18n("Less Than or Equals Condition"));
    d->leCondAction->setCheckable(true);
    d->optionsMenu->addSeparator();
    d->excludeUnrated = d->optionsMenu->addAction(i18n("Exclude Items Without Rating"));
    d->excludeUnrated->setCheckable(true);
    d->optionsBtn->setMenu(d->optionsMenu);

    layout()->setAlignment(d->ratingWidget, Qt::AlignVCenter|Qt::AlignRight);
    setMargin(0);
    setSpacing(0);

    connect(d->optionsMenu, SIGNAL(triggered(QAction*)),
            this, SLOT(slotOptionsTriggered(QAction*)));

    connect(d->optionsMenu, SIGNAL(aboutToShow()),
            this, SLOT(slotOptionsMenu()));

    connect(d->ratingWidget, SIGNAL(signalRatingFilterChanged(int,ImageFilterSettings::RatingCondition,bool)),
            this, SIGNAL(signalRatingFilterChanged(int,ImageFilterSettings::RatingCondition,bool)));
}
예제 #6
0
void tmx::Tileset::init(pugi::xml_node tilesetNode) {
	setFirstGid(tilesetNode.attribute("firstgid").as_int());
	setSource(tilesetNode.attribute("source").as_string());
	setName(tilesetNode.attribute("name").as_string());
	setTileWidth(tilesetNode.attribute("tilewidth").as_uint());
	setTileHeight(tilesetNode.attribute("tileheight").as_uint());
	setSpacing(tilesetNode.attribute("spacing").as_uint());
	setMargin(tilesetNode.attribute("margin").as_uint());

	for(pugi::xml_node prop = tilesetNode.child("properties").first_child(); prop; prop = prop.next_sibling()) {
		mProperties.insert(std::pair<std::string, std::string>(prop.attribute("name").as_string(), prop.attribute("value").as_string()));
	}

	mTileOffset.init(tilesetNode.child("tileoffset"));

	mImage.init(tilesetNode.child("image"));

	mTerrainTypes.init(tilesetNode.child("terraintypes"));

	for(pugi::xml_node tile = tilesetNode.child("tile"); tile; tile = tile.next_sibling("tile")) {
		tmx::Tile tempTile;
		tempTile.setID(tile.attribute("id").as_uint());
		tempTile.setTerrain(tile.attribute("terrain").as_string());
		mTile.push_back(tempTile);
	}
}
QWidget* GeneratingView::createMainWidget()
{

    QLabel *label = new QLabel;
    label->setFixedSize(32,32);
    // FIXME: hidpi
    QString path = ":/resource/theme/images/spinner/32/";
    DMovie *movie = new DMovie(label);
    movie->setMoviePath(path, label);
    movie->start();

    DBaseButton *button = new DBaseButton(tr("Cancel"),this);
    button->setFixedSize(160, 36);
    connect(button, SIGNAL(clicked(bool)), this, SLOT(onCancelButtonClicked()));

    QWidget* mainWidget = new QWidget;

    InfoLabel* text = new InfoLabel;
    text->setText(tr("Generating verification code, please wait... "));

    auto mainLayout = new QVBoxLayout(mainWidget);
    mainLayout->setSpacing(0);
    mainLayout->setMargin(0);

    mainLayout->addSpacing(60);
    mainLayout->addWidget(label, 0, Qt::AlignHCenter);
    mainLayout->addSpacing(30);
    mainLayout->addWidget(text, 0, Qt::AlignHCenter);

    addButton(button);

    return mainWidget;
}
KSimPackageFileWidget::KSimPackageFileWidget(QWidget *parent, const char *name )
	:	PropertyWidget(1, parent,name)
{
	setMargin(0);
	
	m_directories = new KSimDirectorySelector(this, "Package directories");
	m_directories->setTitle(i18n("Package directories:"));
	m_directories->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));
	
	m_files = new KSimFileListSelector(this, "Package files");
	m_files->setTitle(i18n("Package files:"));
	m_files->setFilter(i18n("*.so|Package files (*.so)\n*|All files (*)"));
	m_files->setStartDir(QString::fromLatin1(":<KSimPackageFile>"));

	// Setup data
	
	KConfig * config = kapp->config();
	
	QString group(config->group());
	
	config->setGroup("Packages");
	
	QStringList dirList;
	
	m_dirList = config->readListEntry("Directories");
	m_fileList = config->readListEntry("Files");

	config->setGroup(group);
	
	m_directories->setFileList(m_dirList);
	m_files->setFileList(m_fileList);

}
예제 #9
0
bool QLayout::qt_property( int id, int f, QVariant* v)
{
    switch ( id - staticMetaObject()->propertyOffset() ) {
    case 0: switch( f ) {
	case 0: setMargin(v->asInt()); break;
	case 1: *v = QVariant( this->margin() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 1: switch( f ) {
	case 0: setSpacing(v->asInt()); break;
	case 1: *v = QVariant( this->spacing() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    case 2: switch( f ) {
	case 0: setResizeMode((ResizeMode&)v->asInt()); break;
	case 1: *v = QVariant( (int)this->resizeMode() ); break;
	case 3: case 4: case 5: break;
	default: return FALSE;
    } break;
    default:
	return QObject::qt_property( id, f, v );
    }
    return TRUE;
}
예제 #10
0
DropArea::DropArea(QWidget *parent) : QLabel(parent) {
    setMargin(15);
    setAlignment(Qt::AlignCenter);
    setAcceptDrops(true);
    setAutoFillBackground(true);
    clear();
}
예제 #11
0
void OperatorUi::setupPrimary()
{
	primary_ = new QWidget(this);


	auto primaryLayout = new QHBoxLayout(primary_);

	primaryLayout->setMargin(0);

	primaryLayout->setSpacing(0);

	primaryLayout->setContentsMargins(0,0,0,0);


	ModControl* level = new ModControl("LEVEL", 3, 3, primary_);

	primaryLayout->addWidget(level);


	ModControl* offset = new ModControl("OFFS", 3, 3, primary_);

	primaryLayout->addWidget(offset);


	ModControl* ratio = new ModControl("RATIO", 3, 3, primary_);

	primaryLayout->addWidget(ratio);


	layout_->addWidget(primary_);
}
예제 #12
0
CExportThemeDialog::CExportThemeDialog(QWidget *parent)
                  : QDialog(parent)
{
    auto mainLayout = new QVBoxLayout(this);
    auto page = new QWidget(this);
    auto layout = new QGridLayout(page);
    auto buttonBox = QtCurve::createDialogButtonBox(this);
    if (QWidget *win = window()) {
        win->setWindowTitle(i18n("Export Theme"));
    }
    layout->setSpacing(QApplication::style()
                       ->pixelMetric(QStyle::PM_DefaultLayoutSpacing));
    layout->setMargin(0);
    layout->addWidget(new QLabel(i18n("Name:"), page), 0, 0);
    layout->addWidget(new QLabel(i18n("Comment:"), page), 1, 0);
    layout->addWidget(new QLabel(i18n("Destination folder:"), page), 2, 0);
    layout->addWidget(themeName = new QLineEdit(page), 0, 1);
    layout->addWidget(themeComment = new QLineEdit(i18n("QtCurve based theme"),
                                                   page), 1, 1);
    layout->addWidget(themeUrl=new KUrlRequester(page), 2, 1);
    layout->addItem(new QSpacerItem(2, 2, QSizePolicy::Minimum,
                                    QSizePolicy::Expanding), 3, 1);

    themeUrl->setMode(KFile::Directory | KFile::ExistingOnly |
                      KFile::LocalOnly);
    themeUrl->lineEdit()->setReadOnly(true);
    themeUrl->setUrl(QDir::homePath());

    mainLayout->addWidget(page);
    mainLayout->addWidget(buttonBox);
}
LocalsAndInspectorWindow::LocalsAndInspectorWindow(QWidget *locals,
      QWidget *inspector, QWidget *returnWidget)
    : m_showLocals(false)
{
    auto layout = new QVBoxLayout(this);
    layout->setMargin(0);
    layout->setSpacing(0);

    auto splitter = new Core::MiniSplitter(Qt::Vertical);
    layout->addWidget(splitter);

    auto localsAndInspector = new QStackedWidget;
    localsAndInspector->addWidget(locals);
    localsAndInspector->addWidget(inspector);
    localsAndInspector->setCurrentWidget(inspector);

    splitter->addWidget(localsAndInspector);
    splitter->addWidget(returnWidget);

    splitter->setStretchFactor(0, 3);
    splitter->setStretchFactor(2, 1);
    splitter->setStretchFactor(3, 1);

    // Timer is to prevent flicker when switching between Inpector and Locals
    // when debugger engine changes states.
    m_timer.setSingleShot(true);
    m_timer.setInterval(500); // TODO: remove the magic number!
    connect(&m_timer, &QTimer::timeout, [this, localsAndInspector] {
        localsAndInspector->setCurrentIndex(m_showLocals ? LocalsIndex : InspectorIndex);
    });
}
예제 #14
0
/*!
  \param parent Parent widget
*/
QwtLegendLabel::QwtLegendLabel( QWidget *parent ):
    QwtTextLabel( parent )
{
    d_data = new PrivateData;
    setMargin( Margin );
    setIndent( Margin );
}
예제 #15
0
KstBorderedViewObject::KstBorderedViewObject(const KstBorderedViewObject& borderedViewObject)
: KstViewObject(borderedViewObject) {
  setBorderColor(borderedViewObject.borderColor());
  setBorderWidth(borderedViewObject.borderWidth());
  setMargin(borderedViewObject.margin());
  setPadding(borderedViewObject.padding());
}
예제 #16
0
XKPPlacementLayout::XKPPlacementLayout(int spacing)
    : inSetGeometry(false)
{
    setMargin(0);
    setSpacing(spacing);
    setSizeType(PlacementSize);
}
예제 #17
0
XKPPlacementLayout::XKPPlacementLayout(QWidget *parent, int spacing, int margin)
    : QLayout(parent), inSetGeometry(false)
{
    setMargin(margin);
    setSpacing(spacing);
    setSizeType(PlacementSize);
}
예제 #18
0
// >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void Picker::init() {
	setMargin(Core::TimeSpan(0.0));
	_config.noiseBegin  = 0;
	_config.signalBegin = -30;
	_config.signalEnd   =  10;
	_config.snrMin      =   3;
}
예제 #19
0
RatingBox::RatingBox(QWidget* parent)
    : KVBox(parent), d(new RatingBoxPriv)
{
    setAttribute(Qt::WA_DeleteOnClose);
    setFocusPolicy(Qt::NoFocus);

    d->ratingWidget = new RatingWidget(this);
    d->ratingWidget->setTracking(false);

    d->shortcut = new KSqueezedTextLabel(this);
    QFont fnt   = d->shortcut->font();
    fnt.setItalic(true);
    d->shortcut->setFont(fnt);
    d->shortcut->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
    d->shortcut->setWordWrap(false);

    setMargin(0);
    setSpacing(0);

    // -------------------------------------------------------------

    connect(d->ratingWidget, SIGNAL(signalRatingModified(int)),
            this, SLOT(slotUpdateDescription(int)));

    connect(d->ratingWidget, SIGNAL(signalRatingChanged(int)),
            this, SIGNAL(signalRatingChanged(int)));
}
예제 #20
0
void RaceCircuit::create()
{
    setMargin(2.f);
    
    const float scaling = PhysicsState::engine->simulateScale();
	
    btVector3 * pos = createVertexPos(sNumVertices);
    int i;
    for(i = 0; i < sNumVertices; i++) {
        Vector3F q(sMeshVertices[i * 3] - sMeshNormals[i * 3] * margin(), sMeshVertices[i * 3 + 1]  - sMeshNormals[i * 3 + 1] * margin(), sMeshVertices[i * 3 + 2]  - sMeshNormals[i * 3 + 2] * margin());
        q *= scaling;
        pos[i] = btVector3(q.x, q.y, q.z);
    }
	int * idx = createTriangles(sNumTriangleIndices / 3);
	for(i = 0; i < sNumTriangleIndices; i++) {
        idx[i] = sMeshTriangleIndices[i];
    }
    
    btBvhTriangleMeshShape* shp = createCollisionShape();
	
	Matrix44F trans;
	
	btRigidBody * bd = PhysicsState::engine->createRigidBody(shp, trans, 0.f);
	bd->setFriction(.768f);
}
GoBuildConfigurationWidget::GoBuildConfigurationWidget(GoBuildConfiguration *bc)
    : NamedWidget(nullptr)
    , m_bc(bc)
{
    // Build UI
    auto mainLayout = new QVBoxLayout(this);
    mainLayout->setMargin(0);

    auto detailsWidget = new DetailsWidget();
    detailsWidget->setState(DetailsWidget::NoSummary);
    mainLayout->addWidget(detailsWidget);

    auto detailsInnerWidget = new QWidget();
    auto formLayout = new QFormLayout(detailsInnerWidget);
    detailsWidget->setWidget(detailsInnerWidget);

    m_buildDirectoryChooser = new PathChooser();
    formLayout->addRow(tr("Build directory:"), m_buildDirectoryChooser);

    // Connect signals
    connect(bc, &GoBuildConfiguration::buildDirectoryChanged,
            this, &GoBuildConfigurationWidget::updateUi);
    connect(m_buildDirectoryChooser, &PathChooser::pathChanged,
            this, &GoBuildConfigurationWidget::onPathEdited);

    setDisplayName(tr(Constants::C_GOBUILDCONFIGURATIONWIDGET_DISPLAY));
    updateUi();
}
예제 #22
0
TriggerHealthGiver::TriggerHealthGiver(
	GameWorld* const world,
	Layer* const view_layer,
	geometry::Shape* const bounding_shape,
	const std::string& name,
	const Vec2&	pos,
	const Vec2&	margin,
	double radius,
	int graph_node_index,
	int health_given,
	unsigned int respawn_delay)
	:
	TriggerRespawning<AbstCharacter>(world, bounding_shape),
	_health_given(health_given)
{
	setName(name);
	setPos(pos);
	setMargin(margin);
	setBRadius(radius);
	setGraphNodeIndex(graph_node_index);

	//create this trigger's region of fluence

	setRespawnDelay(respawn_delay);
	//setType(type_health);

	std::string foldername = Prm.StructureFolderName;
	_now_sprite = Sprite::create();
	_now_sprite->setPosition(getPos());
	view_layer->addChild(_now_sprite);

	_label = Label::createWithTTF(
		getName(), Prm.FontFolderName + "/" + "arial" + ".ttf", 15);
	RenderUtil::labelSetting(_now_sprite, _label, Vec2());
}
예제 #23
0
PhysicsTrigger::PhysicsTrigger(Trigger *trigger) {
	// We use the radius of the scale for the trigger since it takes half extents.
	auto shape = new btBoxShape(btConvert(trigger->getScale() * 0.5f));
	shape->setMargin(0.01f);

	// Set the physic's object transformation matrix to be the same
	// as the transform matrix of the game object.
	btTransform transform;
	transform.setIdentity();
	transform.setOrigin(btConvert(trigger->getPosition()));
	transform.setRotation(btConvert(trigger->getRotation()));

	auto state = new btDefaultMotionState();
	state->setWorldTransform(transform);
	mActor = new btRigidBody(0.0f, state, shape);

	// Set the trigger flag on the actor.
	// CF_NO_CONTACT_RESPONSE set's it to be a trigger interaction
	// CF_CUSTOM_MATERIAL_CALLBACK let's us get notifications.
	mActor->setCollisionFlags(
		mActor->getCollisionFlags() | 
		btCollisionObject::CF_NO_CONTACT_RESPONSE | 
		btCollisionObject::CF_CUSTOM_MATERIAL_CALLBACK
	);

	// create a relationship between the trigger and the physics representation
	mTrigger = trigger;
}
예제 #24
0
void MarginValueWidget::setResolution(int dpi)
{
    m_dpi = dpi;
    m_block = true;
    setMargin(m_margin);
    m_block = false;
}
예제 #25
0
FindLineEdit::FindLineEdit(QWidget *parent) : QLineEdit(parent)
{
    auto layout = new QHBoxLayout(this);
    auto clearButton = new QToolButton(this);
    optionsButton = new QToolButton(this);
    optionsButton->setIcon(QIcon(":/images/application-menu.svg"));
    clearButton->setIcon(QIcon(":/images/actions/edit-clear.svg"));
    optionsButton->setFocusPolicy(Qt::NoFocus);
    optionsButton->setPopupMode(QToolButton::InstantPopup);
    optionsButton->setCursor(Qt::ArrowCursor);
    clearButton->setFocusPolicy(Qt::NoFocus);
    clearButton->setCursor(Qt::ArrowCursor);
    optionsButton->setStyleSheet(INNER_BUTTON_STYLE);
    clearButton->setStyleSheet(INNER_BUTTON_STYLE);
    int frameWidth = style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
    setStyleSheet(QString("QLineEdit { padding-right: %1px; padding-left: %2px }\n"
                          "QToolButton::menu-indicator { image: none; }")
                  .arg(clearButton->sizeHint().width() + frameWidth + 1)
                  .arg(optionsButton->sizeHint().width() + frameWidth + 1));
    layout->addWidget(optionsButton, 0, Qt::AlignLeft);
    layout->addWidget(clearButton, 0, Qt::AlignRight);
    layout->setMargin(0);
    layout->setSpacing(0);
    connect(clearButton, SIGNAL(clicked()), this, SLOT(clear()));
    QSize msz = minimumSizeHint();
    setMinimumSize(qMax(msz.width(), clearButton->sizeHint().height() + frameWidth * 2 + 2),
                   qMax(msz.height(), clearButton->sizeHint().height() + frameWidth * 2 + 2));
}
예제 #26
0
ThumbView::ThumbView( QWidget *parent, const char *name )
   : QVBox( parent ),
     m_iconView(0),
     m_job(0)
{
   setMargin(3);
   m_pixWidth = 0;
   m_pixHeight = 0;
   m_thumbMargin = 5;
   m_iconView = new KIconView( this, name );
   m_progress = new KProgress( this );
   m_progress->hide();

   m_pixWidth  = 100;
   m_pixHeight = 100;

   readSettings();

   m_basePix.resize( QSize( m_pixWidth, m_pixHeight ) );
   m_basePix.fill();  // fills white per default TODO


   m_iconView->setItemsMovable( false );

   slSetBackGround();

   connect( m_iconView, SIGNAL( executed( QIconViewItem* )),
	    this, SLOT( slDoubleClicked( QIconViewItem* )));

   m_pendingJobs.setAutoDelete(false);
}
                        OControlLayout :: OControlLayout (ODataWidget *pODataWidget, int32 margin_pix, int32 space_pix )
                     : QGridLayout (pODataWidget->WidgetQ()),
  top_layout(NULL),
  bottom_layout(NULL),
  left_layout(NULL),
  right_layout(NULL),
  corner_layout(),
  spacing(space_pix)
{

  memset(corner_layout,0,sizeof(corner_layout));
  
  setSpacing(space_pix);
  setMargin(margin_pix);
  
  spacer_items[1] = new QSpacerItem(0,0,QSizePolicy::Fixed,QSizePolicy::Fixed);
  addItem(spacer_items[1],1,0,1,5);         // top

  spacer_items[0] = new QSpacerItem(0,0,QSizePolicy::Fixed,QSizePolicy::Fixed);
  addItem(spacer_items[0],0,1,5,1);         // left

  spacer_items[3] = new QSpacerItem(0,0,QSizePolicy::Fixed,QSizePolicy::Fixed);
  addItem(spacer_items[3],3,0,1,5);         // bottom
  
  spacer_items[2] = new QSpacerItem(0,0,QSizePolicy::Fixed,QSizePolicy::Fixed);
  addItem(spacer_items[2],0,3,5,1);         // right


}
예제 #28
0
MyRichText::MyRichText( QWidget *parent, const char *name )
    : QVBox( parent, name )
{
    setMargin( 5 );

    view = new QTextView( this );
    view->setText( "This is a <b>Test</b> with <i>italic</i> <u>stuff</u>" );
    QBrush paper;
    paper.setPixmap( QPixmap( "../richtext/marble.png" ) );
    if ( paper.pixmap() != 0 )
	view->setPaper( paper );
    else
	view->setPaper( white );

    view->setText( sayings[0] );
    view->setMinimumSize( 450, 250 );

    QHBox *buttons = new QHBox( this );
    buttons->setMargin( 5 );

    bClose = new QPushButton( "&Close", buttons );
    bPrev = new QPushButton( "<< &Prev", buttons );
    bNext = new QPushButton( "&Next >>", buttons );

    bPrev->setEnabled( FALSE );

    connect( bClose, SIGNAL( clicked() ), qApp, SLOT( quit() ) );
    connect( bPrev, SIGNAL( clicked() ), this, SLOT( prev() ) );
    connect( bNext, SIGNAL( clicked() ), this, SLOT( next() ) );

    num = 0;
}
예제 #29
0
StatusBarLayout::StatusBarLayout( QWidget* parent )
  : QLayout( parent ),
    mIsDirty( true ),
    mIsEmpty( true )
{
    setMargin( 0 );
}
예제 #30
0
int QLabel::qt_metacall(QMetaObject::Call _c, int _id, void **_a)
{
    _id = QFrame::qt_metacall(_c, _id, _a);
    if (_id < 0)
        return _id;
    if (_c == QMetaObject::InvokeMetaMethod) {
        if (_id < 12)
            qt_static_metacall(this, _c, _id, _a);
        _id -= 12;
    }
#ifndef QT_NO_PROPERTIES
      else if (_c == QMetaObject::ReadProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: *reinterpret_cast< QString*>(_v) = text(); break;
        case 1: *reinterpret_cast< Qt::TextFormat*>(_v) = textFormat(); break;
        case 2: _a[0] = const_cast<void*>(reinterpret_cast<const void*>(pixmap())); break;
        case 3: *reinterpret_cast< bool*>(_v) = hasScaledContents(); break;
        case 4: *reinterpret_cast< Qt::Alignment*>(_v) = alignment(); break;
        case 5: *reinterpret_cast< bool*>(_v) = wordWrap(); break;
        case 6: *reinterpret_cast< int*>(_v) = margin(); break;
        case 7: *reinterpret_cast< int*>(_v) = indent(); break;
        case 8: *reinterpret_cast< bool*>(_v) = openExternalLinks(); break;
        case 9: *reinterpret_cast< Qt::TextInteractionFlags*>(_v) = textInteractionFlags(); break;
        case 10: *reinterpret_cast< bool*>(_v) = hasSelectedText(); break;
        case 11: *reinterpret_cast< QString*>(_v) = selectedText(); break;
        }
        _id -= 12;
    } else if (_c == QMetaObject::WriteProperty) {
        void *_v = _a[0];
        switch (_id) {
        case 0: setText(*reinterpret_cast< QString*>(_v)); break;
        case 1: setTextFormat(*reinterpret_cast< Qt::TextFormat*>(_v)); break;
        case 2: setPixmap(*reinterpret_cast< QPixmap*>(_v)); break;
        case 3: setScaledContents(*reinterpret_cast< bool*>(_v)); break;
        case 4: setAlignment(*reinterpret_cast< Qt::Alignment*>(_v)); break;
        case 5: setWordWrap(*reinterpret_cast< bool*>(_v)); break;
        case 6: setMargin(*reinterpret_cast< int*>(_v)); break;
        case 7: setIndent(*reinterpret_cast< int*>(_v)); break;
        case 8: setOpenExternalLinks(*reinterpret_cast< bool*>(_v)); break;
        case 9: setTextInteractionFlags(*reinterpret_cast< Qt::TextInteractionFlags*>(_v)); break;
        }
        _id -= 12;
    } else if (_c == QMetaObject::ResetProperty) {
        _id -= 12;
    } else if (_c == QMetaObject::QueryPropertyDesignable) {
        _id -= 12;
    } else if (_c == QMetaObject::QueryPropertyScriptable) {
        _id -= 12;
    } else if (_c == QMetaObject::QueryPropertyStored) {
        _id -= 12;
    } else if (_c == QMetaObject::QueryPropertyEditable) {
        _id -= 12;
    } else if (_c == QMetaObject::QueryPropertyUser) {
        _id -= 12;
    }
#endif // QT_NO_PROPERTIES
    return _id;
}